package com.zx._12_算法.字节跳动面试题;

import com.zx._12_算法.TreeNode;

public class 二叉树的镜像 {

    public static void main(String[] args) {
        TreeNode root = TreeNode.root;
        monitor(root);
        TreeNode.loop();
    }

    public static void monitor(TreeNode node) {
        if (node == null) {
            return;
        }
        TreeNode left = node.left;
        TreeNode right = node.right;

        node.left = right;
        node.right = left;

        monitor(left);
        monitor(right);
    }

}
